<template>
	<view class="changeInfo">
		<view class="tab">
			<navigator open-type="switchTab" url="/pages/personal/personal" class="iconfont icon-fanhui icon" ></navigator>
			编辑个人资料
		</view>
		<view class="author-box">
			<view class="author-img">
				<view class="">
					<image @click="changeImage" class="img" :src="src"></image>
				</view>
				<view class="text">
					点更换头像
				</view>
			</view>
		</view>
		<navigator open-type="redirect" class="text-box" url="/pages/modify/modify?title=userName">
			<view class="left">
				昵称
			</view>
			<view class="iconfont icon-xiangyou float">
				
			</view>
			<view class="right">
				{{userName}}
			</view>
		</navigator>
		<navigator open-type="redirect" class="text-box" url="/pages/modify/modify?title=douyinId">
			<view class="left">
				抖音号
			</view>
			<view class="iconfont icon-xiangyou float">
				
			</view>
			<view class="right">
				{{douyinId}}
			</view>
		</navigator>
		<view class="text-box">
			<view class="left">
				简介
			</view>
			<view class="iconfont icon-xiangyou float">
				
			</view>
			<view class="right">
				填写个人简介容易获得别人关注哦
			</view>
		</view>
		<view class="text-box">
			<view class="left">
				学校
			</view>
			<view class="iconfont icon-xiangyou float">
				
			</view>
			<view class="right">
				
			</view>
		</view>
		<view class="text-box">
			<view class="left">
				性别
			</view>
			<view class="iconfont icon-xiangyou float">
				
			</view>
			<view class="right">
				点击选择性别
			</view>
		</view>
		<view class="text-box">
			<view class="left">
				生日
			</view>
			<view class="iconfont icon-xiangyou float">
				
			</view>
			<view class="right">
				2000-01-23
			</view>
		</view>
		<view class="text-box">
			<view class="left">
				地区
			</view>
			<view class="iconfont icon-xiangyou float">
				
			</view>
			<view class="right">
				爱尔兰 利默里克
			</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				src:'http://localhost:8099/img/2.jpg',
				userName:'张三',
				douyinId:'asf141234'
			}
		},
		onShow() {
			this.getuserName();
			this.getdouyinId();
		},
		methods: {
			getuserName(){
				let that = this;
				uni.getStorage({
					key:'userName',
					success(res){
						that.userName=res.data;
					}
				})
			},
			getdouyinId(){
				let that = this;
				uni.getStorage({
					key:'douyinId',
					success(res){
						that.douyinId=res.data;
					}
				})
			},
			goTo(){
				console.log('跳转到个人');
				uni.navigateBack({
					url:"/pages/personal/personal",
					success: (res) => {
						console.log('跳转到个人');
					}
				})
			},
			changeImage(){
				uni.chooseImage({
					count:1,
					sourceType:['album'],
					sizeType:['original','compressed'],
					success: (res) => {
						console.log(res);
						this.src=res.tempFilePaths
					}
				})
			}
		}
	}
</script>

<style>
.tab{
	height: 80px;
	background-color: #000000;
	font-size: 16px;
	color:#fff;
	text-align: center;
	line-height: 100px;
}
.icon{
	font-size: 16px;
	float: left;
	margin-left: 5px;
}
.author-box{
	height: 150px;
	width: 100%;
	margin:0 auto;
	border-top: 1px #333333 solid;
	border-bottom: 1px #333333 solid;
}
.author-img{
	text-align: center;
}
.img{
	margin-top:20px;
	height: 70px;
	width: 70px;
	border-radius: 50%;
}
.text{
	margin-top: 13px;
	color: #999;
	font-size: 13px;
}
.changeInfo{
	background-color: #000000;
	height: 100%;
}
.text-box{
	height: 40px;
	line-height: 40px;
	color: #999;
	border-bottom: 1px solid #2C405A;
}
.right{
	float: right;
	color: #5e5e5e;
	margin-right: 5px;
}
.float{
	float: right;
	margin-right: 5px;
}
.left{
	line-height: 40px;
	width: 20%;
	float: left;
	margin-left: 15px;
}
</style>
